<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
		<meta name="aplus-terminal" content="1"/>
		<meta name="keywords" content="SHOPDZ" />
		<meta name="apple-mobile-web-app-title" content="SHOPDZ"/>
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
		<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"/>
		<title>拼团-拼团首页</title>
		<link rel="shortcut icon" href="../../../wap/favicon.ico">
		<link rel="stylesheet" href="../public/css/reset.css" />
		<link rel="stylesheet" href="../public/css/style.css" />
		<link rel="stylesheet" href="../../../wap/css/common.css" />
		<script type="text/javascript" src="../../../wap/js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript" src="../../../wap/js/common.js"></script>
		<script type="text/javascript" src="../../../wap/js/template.js"></script>
</head>
<body>
	<div class="wrapper bgfa">
				<div id="plugins_header_has_nav">
				</div>
		<!--content开始-->
			<div class="contentT">
				<div class="tab-titleBox fixedBox">
					<ul class="tab-title" id="tab-title"> 
						<li class="font-red">拼团首页</li>
						<li>我的拼团</li>
						<p class="groupBor"></p>
					</ul> 
				</div>
				<div id="tab-content" class="tab-content">
					<div class="show group-list active_list">
						<img src="../public/images/groupBan1.png" alt="" class="groupBan" id="group_img"/>
						<div class="playGroup">
							<a href="./groupplay.html">
								<span class="playGroup-tit">拼团玩法</span>
								<img src="../public/images/jtr.png" alt="" class="playGroup-point"/>
							</a>
						</div>
						<ul class="groupStep-list">
							<li><span class="groupStep-num">1</span>选择商品</li>
							<li><span class="groupStep-num">2</span>支付开团</li>
							<li><span class="groupStep-num">3</span>邀请好友</li>
							<li><span class="groupStep-num">4</span>拼团成功</li>
						</ul>
						<div id="fightgrouplist"></div>
						<script id="fightgroupcontent" type="text/html">
						
						<%if(data.length > 0){%>
							<%for(i=0;i<data.length;i++){%>
								<%var value = data[i];%>
						<div class="group-commodity">
							<div class="commodityImg-box">
								<img src="<%=value.group_image%>" alt=""  class="commodityImg"/>
								<div class="groupIntroduce">
									<div class="introduceCover"></div>
									<div class="introduceCon">
										<span class="groupPerson-num"><%=value.group_person_num%>人团</span>
										<% if(value.head_welfare_text){%>
										<img src="../public/images/groupH.png" alt="" class="groupHead"/>
										<p class="groupHead-welfare">团长福利：<span><%=value.head_welfare_text%></span></p>
										<%}%>
									</div>
								</div>
							</div>
							<div class="group-comDet">
								<div class="group-comName"><%=value.goods_name%></div>
								<p  class="group-comDescribe"><%=value.group_content%></p>
								<p class="group-comDescribe group-conTime">活动时间：<span><%=value.starttime_text%>-<%=value.endtime_text%></span></p>
								<div class="groupOpen">
									<p class="group-comPrice"><span class="group-newPrice">¥<%=value.group_price%></span><span class="group-oldPrice">¥<%=value.goods_price%></span></p>
									<a href="<%=rootUrl%>plugins/group/wap/groupdet.html?active_id=<%=value.id%>">
									<input type="button" value="我要开团" class="groupOpen-btn"/>
									</a>
								</div>
							</div>
						</div>
							<%}%>
						<%}%>
						</script>
					</div>
					
					<div class="group-list mygroup_list">
						<div id="mygroup"></div>
						<script id="mygroupcontent" type="text/html">
						<%if(data.length > 0){%>
							<%for(i=0;i<data.length;i++){%>
								<%var value = data[i];%>
						<div class="myGroup-box">
							<dl class="myGroup-commodity">
								<dt class="myGroup-comDt"><img src="<%=value['group']['group_image']%>" alt=""  class="myGroup-comImg"/></dt>
								<dd class="myGroup-comDd">
									<div class="myGroup-statu">
										<span class="groupPerson-num"><%=value['group']['group_person_num']%>人团</span>
										<%if(value['group_group']['status'] == 0){%>
											<span class="myGroup-statuBtn myGroup-progressBtn">正在进行</span>
										<%}else if(value['group_group']['status'] == 1){%>
											<span class="myGroup-statuBtn myGroup-progressBtn">拼团成功</span>
										<%} else if(value['group_group']['status'] < 0){%>
											<span class="myGroup-statuBtn myGroup-progressBtn">拼团失败</span>
										<%};%>
									</div>
									<p class="myGroup-comName"><%=value['group']['goods_name']%></p>
									<div class="myGroup-comSpec"><span><%=value['group']['spec_name']%></span></div>
									<div class="myGroup-comDet">
										<span class="group-newPrice">¥<%=value['group']['group_price']%></span>
										<span class="group-oldPrice">¥<%=value['group']['goods_price']%></span>
									</div>
								</dd>
							</dl>
							<div class="myGroup-btnBox">
							<%if(value['refund_status'] == 0){%>
								<a href="javascript:void(0)" class="myGroup-progressWord marR4">待付款订单</a>
								<a href="./groupsettlement.html?order_sn=<%=value['order_sn']%>" class="myGroup-btn mustPay">立即付款</a>
							<%}else {%>
								<a href="./groupdetails.html?order_sn=<%=value['order_sn']%>" class="myGroup-btn marR4">订单详情</a>
								<a href="./groupInvitation.html?active_id=<%=value['active_id']%>&group_id=<%=value['group_id']%>" class="myGroup-btn">拼团详情</a>
							<%}%>
							</div>
						</div>
							<%}%>
						<%}%>
						</script>
					</div>
				</div>
			</div>
			<!--content结束-->
		</div>
		<script type="text/javascript" src="../public/js/group.js"></script>
		<script language="javascript">
			getGroupSet();
			getfightgroup();
			$(function(){
				$('#tab-title li').click(function(){
					var liindex = $('#tab-title li').index(this);
					var liWidth = $('#tab-title li').width();
					var comWidth = $('#tab-title').width();
					$(this).addClass('font-red').siblings().removeClass('font-red');
					$("#tab-content > div").removeClass('show').eq($('#tab-title li').index(this)).addClass('show');
					if(liindex == 0){
						tab_li = $('#tab-title li:eq(0)');
						$('.groupBor').stop(false,true).animate({'left' : (comWidth*0.14) + 'px'},300);
						getfightgroup();
					} else {
						$('.groupBor').stop(false,true).animate({'left' : (liindex * liWidth) + (comWidth*0.42) + 'px'},300);
						tab_li = $('#tab-title li:eq(1)');
						getmygroup();
					}
				});
			});
			
		</script>
</body>
</html>